package com.dang.alex.service;

import com.dang.alex.dao.DAOFactory;
import com.dang.alex.model.User;

public class UserserviceImp implements Userservice{

	
	public void save(User u) throws Exception {
		new DAOFactory().getUserDao().save(u);
		
	}

	@Override
	public User findById(int id) {
		
		return new DAOFactory().getUserDao().findById(id);
	}

	@Override
	public User findByEmail(String email) throws Exception {
		return new DAOFactory().getUserDao().findByEmail(email);
	}

	@Override
	public void upDate(User u) throws Exception {
		new DAOFactory().getUserDao().upDate(u);
		
	}

	@Override
	public User translate(String email, String password) throws Exception {
		
		return new DAOFactory().getUserDao().translate(email, password);
	}

	
}
